#include <stdio.h>
int main()
{
    char string[80],c;
    int i=0,num,word;
    num=0;
    word=0;
    gets(string);
    while((c=string[i++])!='\0')
        if(c==' '||c==','||c=='.')
        word=0;
    else
        if(word==0)
        {
            word=1;num++;
        }
    printf("%d",num);
  return(0);
}
